import { getSubCategory } from '@/network/category';
import {ref, onMounted} from 'vue'
import {useRoute} from 'vue-router'

export function useCategorySub() {
   
    const route = useRoute()
    const subCategory = ref({})
    async function getSub() {
        const res = await getSubCategory(route.params.id)
        // console.log(res);
        subCategory.value = res.result
    }

    onMounted(() => {
        getSub()
    })

    return {subCategory}
}